# _*_ coding:utf-8 _*_
__author__ = 'joker_wb'
__date__ = '2018/3/17 21:07'
import xadmin
from xadmin import views
from.models import EmailVerifyRecord
from .models import Banner

class BaseSetting(object):
    """
    用来修改主题
    """
    enable_themes=True#主题功能
    use_bootswatch=True#


class GlobalSetting(object):
    site_title='王博后台管理系统'#设置页面左上角的字符
    site_footer='神圣天帝叶凡公司'#最底部的信息
    menu_style='accordion'#将APP收起来

class EmailVerifyRecordAdmin(object):
    """
    注意，继承object
    """
    list_display=['code','email','send_type','send_time',]
    search_fields=['code','email','send_type']#添加搜索功能
    list_filter=['code','email','send_type','send_time']#添加过滤器

class BannerAdmin(object):
    list_display=['title','img','url','index','add_time']
    search_fields=['title','img','url','index',]
    list_filter=['title','img','url','index','add_time']
xadmin.site.register(EmailVerifyRecord,EmailVerifyRecordAdmin)
xadmin.site.register(Banner,BannerAdmin)
xadmin.site.register(views.BaseAdminView,BaseSetting)
xadmin.site.register(views.CommAdminView,GlobalSetting)